package com.qf.entity;

import javax.persistence.*;
import java.util.Date;

/**
 * 2019/9/29
 * Administrator
 * springdata0928
 * 面向对象面向君  不负代码不负卿
 */
//雇员表
@Entity
public class Emp {
    @Id
    private String empno;

    @Override
    public String toString() {
        return "Emp{" +
                "empno='" + empno + '\'' +
                ", empName='" + empName + '\'' +
                ", birthday=" + birthday +
                ", age=" + age +
                ", dept=" + dept +
                '}';
    }

    @Column
    private String empName;
    @Column
    private Date birthday;
    @Column
    private int age;

    @ManyToOne
    @JoinColumn(name="depid")  //name="外键列名"
    private Dept dept;

    public String getEmpno() {
        return empno;
    }

    public void setEmpno(String empno) {
        this.empno = empno;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }
}
